package com.fan.controller;

import com.fan.dao.OrderDao;
import com.fan.service.OrderService;
import com.fan.utils.CommonResults;
import com.sixth.until.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: self-tui-education
 * @description:
 * @author: 老范
 * @create: 2022-05-09 17:32
 **/
@RestController
@RequestMapping("/order/order")

@Api(tags = "订单功能模块")
public class OrderController {

    @Autowired
    private OrderService orderService;
    @Autowired
    private OrderDao orderDao;



    //    根据课程id和会员id查询是否购买
    @ApiOperation(value = "根据课程id和会员Id查询支付状态")
    @PostMapping("/getOrderStatus/{id}/{HuiYuanId}")
    public CommonResults getOrderStatus(@PathVariable("id") String id, @PathVariable("HuiYuanId") String HuiYuanId){

        CommonResults status = orderService.getOrderStatusByCourseIdAndHuiYuanId(id, HuiYuanId);
        return status;
    }
}
